<template>
  <div>
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recommend></Recommend>
    <Rank></Rank>
    <Like></Like>
    <Floor v-for="floor in floorList" :key="floor.id" :list="floor"></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import ListContainer from "./listContainer/index.vue"
import Recommend from "./recommed/recommed.vue"
import Rank from "./rank/rank.vue"
import Like from "./like/like.vue"
import Floor from "./floor/floor.vue"
import Brand from "./brand/brand.vue"
import {mapState} from "vuex"

export default {
  name: "Home",
  components: {
    ListContainer,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand
  },

  mounted(){
    // 获取floor组件数据
    this.$store.dispatch("getFloorList")
  },

  computed: {
    ...mapState({
      floorList: (state) => state.home.floorList,
    })
  },

};
</script>

<style scoped>
</style>